<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>6盒子模型</title>
</head>
<style>
    .card{
        width: 300px;
        background-color: yellow;
        padding: 10px;
        margin-bottom: 30px;/*单下边间距，不加bottom则是四个方向都是30*/
    }
    .card>img{
        width: 100%;

    }
    .card>p{
        border: solid red 5px;
        margin: 10px 20px 30px 40px;/*上 右 下 左 顺时针*/
    }
    .card1{
        width: 300px;
        height: 300px;
        background-color: yellow;
        overflow: hidden;/*结界 不然text的margin找上边去了*/

    }
    .card1>.text{
        width: 200px;
        height: 200px;
        background-color: red;
        margin-top: 60px;
        margin-left: 60px;
    }
</style>
<body>
<div class="card">
    <img src="img/1.png" alt="">
    <p>我是文字</p>
</div>
<div class="card">
    <img src="img/1.png" alt="">
    <p>我是文字</p>
</div>

<div class="card1">
    <div class="text">123456789</div>

</div>

</body>
</html>